package com.itheima.app.interceptor;

import com.itheima.domain.db.User;

// 线程内存储 user对象
public class UserHolder {

    private static final ThreadLocal<User> TLUser = new ThreadLocal<User>();

    // 设置
    public static void set(User user) {
        TLUser.set(user);
    }
    // 获取
    public static User get() {
        return TLUser.get();
    }
    // 移除
    public static void remove() {
        TLUser.remove();
    }
}
